# name : normal.n.power.fun n|power
# key: normal.n.power.fun
# contributor: Shuguang Sun
# --
${1:ttenevent} <- function(x) {
  delta0 <- 0
  c <- sqrt(x$ratio)/(1 + x$ratio)
  delta <- -c * (x$delta - delta0) / x$sd
  zalpha <- qnorm(1 - x$alpha/x$sided)
  zb <- qnorm(1- x$beta)
  n <- (zalpha + zb)^2 / delta^2
  n
}
$1(x)